<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>获取树节点的路径</title>
    <script>
    let res = {
    "code": "0",
    "isSuccess": true,
    "message": "ok!",
    "errorCode": "0",
    "data": {
        "treeType": "0",
        "treeData": {
            "nodeId": "3586",
            "nodeName": "思源物业",
            "parentId": "0",
            "subContract": null,
            "nodeType": "1",
            "layer": "0",
            "authFlag": false,
            "childList": [
                {
                    "nodeId": "3616",
                    "nodeName": "物业总部",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": []
                },
                {
                    "nodeId": "3588",
                    "nodeName": "浙江区域公司",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": [
                        {
                            "nodeId": "3964",
                            "nodeName": "舟山分公司",
                            "parentId": "3588",
                            "subContract": null,
                            "nodeType": "3",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "3615",
                                    "nodeName": "天苑花园",
                                    "parentId": "3964",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "366300630064562176",
                                            "nodeName": "天苑花园",
                                            "parentId": "3615",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "nodeId": "3635",
                            "nodeName": "宁波台州分公司",
                            "parentId": "3588",
                            "subContract": null,
                            "nodeType": "3",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "3939",
                                    "nodeName": "湖滨雅苑管理处",
                                    "parentId": "3635",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "426824118743076864",
                                            "nodeName": "湖滨雅苑",
                                            "parentId": "3939",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3596",
                                    "nodeName": "香颂森林管理处",
                                    "parentId": "3635",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "316946756426268672",
                                            "nodeName": "森林新都孔雀城",
                                            "parentId": "3596",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3636",
                                    "nodeName": "黄岩永江管理处",
                                    "parentId": "3635",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "337982748587196416",
                                            "nodeName": "西海湾",
                                            "parentId": "3636",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                {
                    "nodeId": "3948",
                    "nodeName": "东北区域公司",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": [
                        {
                            "nodeId": "3952",
                            "nodeName": "吉林分公司",
                            "parentId": "3948",
                            "subContract": null,
                            "nodeType": "3",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "3965",
                                    "nodeName": "金地花园",
                                    "parentId": "3952",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "447199239789871104",
                                            "nodeName": "金地花园",
                                            "parentId": "3965",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "nodeId": "3951",
                            "nodeName": "哈尔滨分公司",
                            "parentId": "3948",
                            "subContract": null,
                            "nodeType": "3",
                            "layer": "2",
                            "authFlag": false,
                            "childList": []
                        },
                        {
                            "nodeId": "3950",
                            "nodeName": "吉林管理处",
                            "parentId": "3948",
                            "subContract": null,
                            "nodeType": "4",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "427842076961406976",
                                    "nodeName": "吉林春天",
                                    "parentId": "3950",
                                    "subContract": null,
                                    "nodeType": "5",
                                    "layer": null,
                                    "authFlag": false,
                                    "childList": []
                                }
                            ]
                        },
                        {
                            "nodeId": "3949",
                            "nodeName": "长春管理处",
                            "parentId": "3948",
                            "subContract": null,
                            "nodeType": "4",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "427841819611496448",
                                    "nodeName": "阳光春天",
                                    "parentId": "3949",
                                    "subContract": null,
                                    "nodeType": "5",
                                    "layer": null,
                                    "authFlag": false,
                                    "childList": []
                                }
                            ]
                        }
                    ]
                },
                {
                    "nodeId": "3624",
                    "nodeName": "华中区域公司",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "3",
                    "layer": "1",
                    "authFlag": false,
                    "childList": [
                        {
                            "nodeId": "3752",
                            "nodeName": "总部测试项目01",
                            "parentId": "3624",
                            "subContract": null,
                            "nodeType": "4",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "427125533524889600",
                                    "nodeName": "总部楼盘",
                                    "parentId": "3752",
                                    "subContract": null,
                                    "nodeType": "5",
                                    "layer": null,
                                    "authFlag": false,
                                    "childList": []
                                }
                            ]
                        },
                        {
                            "nodeId": "3626",
                            "nodeName": "思源大厦",
                            "parentId": "3624",
                            "subContract": null,
                            "nodeType": "4",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "319142118096375808",
                                    "nodeName": "思源大厦管理处",
                                    "parentId": "3626",
                                    "subContract": null,
                                    "nodeType": "5",
                                    "layer": null,
                                    "authFlag": false,
                                    "childList": []
                                }
                            ]
                        },
                        {
                            "nodeId": "3966",
                            "nodeName": "000",
                            "parentId": "3624",
                            "subContract": null,
                            "nodeType": "2",
                            "layer": "3",
                            "authFlag": false,
                            "childList": []
                        }
                    ]
                },
                {
                    "nodeId": "3628",
                    "nodeName": "华西区域公司",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": [
                        {
                            "nodeId": "3629",
                            "nodeName": "重庆分公司",
                            "parentId": "3628",
                            "subContract": null,
                            "nodeType": "3",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "3670",
                                    "nodeName": "重庆测试项目2",
                                    "parentId": "3629",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "411951560168308736",
                                            "nodeName": "11",
                                            "parentId": "3670",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3630",
                                    "nodeName": "重庆中电大厦",
                                    "parentId": "3629",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "323458087270748160",
                                            "nodeName": "中电照明大厦",
                                            "parentId": "3630",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                {
                    "nodeId": "3963",
                    "nodeName": "华东区域公司",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": [
                        {
                            "nodeId": "3614",
                            "nodeName": "上海分公司",
                            "parentId": "3963",
                            "subContract": null,
                            "nodeType": "3",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "3691",
                                    "nodeName": "上海测试项目20",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "462740637117054976",
                                            "nodeName": "新新家园",
                                            "parentId": "3691",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3690",
                                    "nodeName": "上海测试项目19",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3689",
                                    "nodeName": "上海测试项目18",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3688",
                                    "nodeName": "上海测试项目17",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3687",
                                    "nodeName": "上海测试项目16",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3686",
                                    "nodeName": "上海测试项目15",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3685",
                                    "nodeName": "上海测试项目14",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3684",
                                    "nodeName": "上海测试项目13",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3683",
                                    "nodeName": "上海测试项目12",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3682",
                                    "nodeName": "上海测试项目11",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3681",
                                    "nodeName": "上海测试项目10",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3680",
                                    "nodeName": "上海测试项目9",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3679",
                                    "nodeName": "上海测试项目8",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3678",
                                    "nodeName": "上海测试项目7",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3677",
                                    "nodeName": "上海测试项目6",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3676",
                                    "nodeName": "上海测试项目5",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3675",
                                    "nodeName": "上海测试项目4",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3674",
                                    "nodeName": "上海测试项目3",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3673",
                                    "nodeName": "上海测试项目2",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3672",
                                    "nodeName": "上海测试项目1",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3634",
                                    "nodeName": "上海测试",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "333582356470300672",
                                            "nodeName": "环城公馆",
                                            "parentId": "3634",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3631",
                                    "nodeName": "上海中心",
                                    "parentId": "3614",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "323495893246414848",
                                            "nodeName": "杨浦小区",
                                            "parentId": "3631",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                {
                    "nodeId": "3589",
                    "nodeName": "华南区域公司",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": [
                        {
                            "nodeId": "3595",
                            "nodeName": "深圳分公司",
                            "parentId": "3589",
                            "subContract": null,
                            "nodeType": "3",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "3711",
                                    "nodeName": "深圳测试项目20",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "381165554796331008",
                                            "nodeName": "飞羽凤尾",
                                            "parentId": "3711",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3710",
                                    "nodeName": "深圳测试项目19",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "427849605409931264",
                                            "nodeName": "首地容御",
                                            "parentId": "3710",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3709",
                                    "nodeName": "深圳测试项目18",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3708",
                                    "nodeName": "深圳测试项目17",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3707",
                                    "nodeName": "深圳测试项目16",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3706",
                                    "nodeName": "深圳测试项目15",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3705",
                                    "nodeName": "深圳测试项目14",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3704",
                                    "nodeName": "深圳测试项目13",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3703",
                                    "nodeName": "深圳测试项目12",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3702",
                                    "nodeName": "深圳测试项目11",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3701",
                                    "nodeName": "深圳测试项目10",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3700",
                                    "nodeName": "深圳测试项目09",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3699",
                                    "nodeName": "深圳测试项目08",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3698",
                                    "nodeName": "深圳测试项目07",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3697",
                                    "nodeName": "深圳测试项目06",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3696",
                                    "nodeName": "深圳测试项目05",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3695",
                                    "nodeName": "深圳测试项目04",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3694",
                                    "nodeName": "深圳测试项目03",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3693",
                                    "nodeName": "深圳测试项目02",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3692",
                                    "nodeName": "深圳测试项目01",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "443407929538777088",
                                            "nodeName": "深圳测试楼盘01",
                                            "parentId": "3692",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3627",
                                    "nodeName": "邻水湾管理处",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "320877216764268544",
                                            "nodeName": "邻水湾花园",
                                            "parentId": "3627",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3597",
                                    "nodeName": "金熙管理处",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "328227303697940480",
                                            "nodeName": "登云山城",
                                            "parentId": "3597",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3638",
                                    "nodeName": "理想城",
                                    "parentId": "3595",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "337981632780697600",
                                            "nodeName": "理想城花园",
                                            "parentId": "3638",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "nodeId": "3594",
                            "nodeName": "广州分公司",
                            "parentId": "3589",
                            "subContract": null,
                            "nodeType": "3",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "4009",
                                    "nodeName": "广州测试项目50",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "475738680070246400",
                                            "nodeName": "未来万科城",
                                            "parentId": "4009",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3731",
                                    "nodeName": "广州测试项目20",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "367051311620816896",
                                            "nodeName": "锦绣联合商务大厦",
                                            "parentId": "3731",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3730",
                                    "nodeName": "广州测试项目19",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "367247004042002432",
                                            "nodeName": "天秀大厦",
                                            "parentId": "3730",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3729",
                                    "nodeName": "广州测试项目18",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3728",
                                    "nodeName": "广州测试项目17",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3727",
                                    "nodeName": "广州测试项目16",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3726",
                                    "nodeName": "广州测试项目15",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3725",
                                    "nodeName": "广州测试项目14",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3724",
                                    "nodeName": "广州测试项目13",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3723",
                                    "nodeName": "广州测试项目12",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3722",
                                    "nodeName": "广州测试项目11",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3721",
                                    "nodeName": "广州测试项目10",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3720",
                                    "nodeName": "广州测试项目09",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3719",
                                    "nodeName": "广州测试项目08",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3718",
                                    "nodeName": "广州测试项目07",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3717",
                                    "nodeName": "广州测试项目06",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3716",
                                    "nodeName": "广州测试项目05",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3715",
                                    "nodeName": "广州测试项目04",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3714",
                                    "nodeName": "广州测试项目03",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3713",
                                    "nodeName": "广州测试项目02",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3712",
                                    "nodeName": "广州测试项目01",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "388469295237038080",
                                            "nodeName": "1楼盘",
                                            "parentId": "3712",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3605",
                                    "nodeName": "金真花园管理处",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "317975291290976256",
                                            "nodeName": "和丰大厦",
                                            "parentId": "3605",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3598",
                                    "nodeName": "龙腾管理处",
                                    "parentId": "3594",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "316960176097722368",
                                            "nodeName": "永清花语城",
                                            "parentId": "3598",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                {
                    "nodeId": "3587",
                    "nodeName": "华北区域公司",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": [
                        {
                            "nodeId": "3590",
                            "nodeName": "北京分公司",
                            "parentId": "3587",
                            "subContract": null,
                            "nodeType": "3",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "3751",
                                    "nodeName": "北京测试项目20",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "397806128206974976",
                                            "nodeName": "北京测试项目2.0",
                                            "parentId": "3751",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3750",
                                    "nodeName": "北京测试项目19",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3749",
                                    "nodeName": "北京测试项目18",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3748",
                                    "nodeName": "北京测试项目17",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3747",
                                    "nodeName": "北京测试项目16",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3746",
                                    "nodeName": "北京测试项目15",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3745",
                                    "nodeName": "北京测试项目14",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3744",
                                    "nodeName": "北京测试项目13",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3743",
                                    "nodeName": "北京测试项目12",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3742",
                                    "nodeName": "北京测试项目11",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3741",
                                    "nodeName": "北京测试项目10",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3740",
                                    "nodeName": "北京测试项目09",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "474931228139589632",
                                            "nodeName": "龙腾家园",
                                            "parentId": "3740",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3739",
                                    "nodeName": "北京测试项目08",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3738",
                                    "nodeName": "北京测试项目07",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3737",
                                    "nodeName": "北京测试项目06",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3736",
                                    "nodeName": "北京测试项目05",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3735",
                                    "nodeName": "北京测试项目04",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3734",
                                    "nodeName": "北京测试项目03",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3733",
                                    "nodeName": "北京测试项目02",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                },
                                {
                                    "nodeId": "3732",
                                    "nodeName": "北京测试项目01",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "474931602263117824",
                                            "nodeName": "01栋",
                                            "parentId": "3732",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3592",
                                    "nodeName": "银河世纪管理处",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "317028536785305600",
                                            "nodeName": "晟世·北京时代",
                                            "parentId": "3592",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                },
                                {
                                    "nodeId": "3593",
                                    "nodeName": "天通苑管理处",
                                    "parentId": "3590",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "317028802800648192",
                                            "nodeName": "碧桂园·悦融华",
                                            "parentId": "3593",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "nodeId": "3591",
                            "nodeName": "河北分公司",
                            "parentId": "3587",
                            "subContract": null,
                            "nodeType": "3",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "3669",
                                    "nodeName": "盛世嘉园",
                                    "parentId": "3591",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "366948620714377216",
                                            "nodeName": "盛世嘉园",
                                            "parentId": "3669",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                {
                    "nodeId": "4057",
                    "nodeName": "深保利",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": [
                        {
                            "nodeId": "4058",
                            "nodeName": "深圳公司",
                            "parentId": "4057",
                            "subContract": null,
                            "nodeType": "3",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "4059",
                                    "nodeName": "国人大厦",
                                    "parentId": "4058",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                }
                            ]
                        }
                    ]
                },
                {
                    "nodeId": "3983",
                    "nodeName": "华南区域",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": []
                },
                {
                    "nodeId": "3982",
                    "nodeName": "西南区域",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": []
                },
                {
                    "nodeId": "3981",
                    "nodeName": "苏中商业",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": []
                },
                {
                    "nodeId": "3980",
                    "nodeName": "沪浙区域",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": []
                },
                {
                    "nodeId": "3979",
                    "nodeName": "成渝区域",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": []
                },
                {
                    "nodeId": "3978",
                    "nodeName": "西安区域",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": []
                },
                {
                    "nodeId": "3977",
                    "nodeName": "山东区域",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": []
                },
                {
                    "nodeId": "3976",
                    "nodeName": "北方区域",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": [
                        {
                            "nodeId": "4052",
                            "nodeName": "长春分公司",
                            "parentId": "3976",
                            "subContract": null,
                            "nodeType": "3",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "4054",
                                    "nodeName": "恒大悦府",
                                    "parentId": "4052",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": []
                                }
                            ]
                        }
                    ]
                },
                {
                    "nodeId": "3975",
                    "nodeName": "海南区域",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": []
                },
                {
                    "nodeId": "3974",
                    "nodeName": "华中区域",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": []
                },
                {
                    "nodeId": "3973",
                    "nodeName": "苏南区域",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": []
                },
                {
                    "nodeId": "3968",
                    "nodeName": "苏中区域",
                    "parentId": "3586",
                    "subContract": null,
                    "nodeType": "2",
                    "layer": "1",
                    "authFlag": false,
                    "childList": [
                        {
                            "nodeId": "3969",
                            "nodeName": "海门分公司",
                            "parentId": "3968",
                            "subContract": null,
                            "nodeType": "3",
                            "layer": "2",
                            "authFlag": false,
                            "childList": [
                                {
                                    "nodeId": "3971",
                                    "nodeName": "中南锦苑",
                                    "parentId": "3969",
                                    "subContract": null,
                                    "nodeType": "4",
                                    "layer": "3",
                                    "authFlag": false,
                                    "childList": [
                                        {
                                            "nodeId": "472352712411840512",
                                            "nodeName": "海门锦苑",
                                            "parentId": "3971",
                                            "subContract": null,
                                            "nodeType": "5",
                                            "layer": null,
                                            "authFlag": false,
                                            "childList": []
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        "description": "描述：0全量树,1节点树"
    }
}
    </script>
</head>
<body>
    <script>
        // 查找树叶子节点的路径 https://www.cnblogs.com/lycnblogs/p/6874389.html
        function getPathByNodeId(treeData, nodeId) {
            let tempPath = [];
            try {
                const loopFn = (itemObj) => {
                    tempPath.push(itemObj);
                    if (itemObj.nodeId === nodeId && itemObj.nodeType === '5') { // 找到符合条件的节点，通过throw终止掉递归
                        throw ('GOT IT!');
                    }
                    if (itemObj.nodeType === '5') { // 如果是叶子节点
                        tempPath.pop();
                    } else {
                        let childList = itemObj.childList || [];
                        for (let i = 0; i < childList.length; i++) {
                            loopFn(childList[i]);
                        }
                        // 当前节点的子节点遍历完依旧没找到，则删除路径中的该节点
                        tempPath.pop();
                    }                    
                }
                loopFn(treeData);
            } catch (err) {
                return tempPath;
            }
        }

        let path = getPathByNodeId(res.data.treeData, '316946756426268672');
        console.log(path);

        /**
        *  根据项目Id查找项目，如果找不到项目, 则返回第一个项目节点
        * @param 项目树数据 treeData
        * @param 项目Id projectId
        */
        function findProjectById (treeData, projectId) {
            let findedProject = null;
            try {
                const loopFn = (itemObj) => {
                    if (itemObj.nodeType === '5') {
                        if (!findedProject) { // 处理第一个项目节点
                            findedProject = itemObj;
                        }
                        if (itemObj.nodeId === projectId) {
                            findedProject = itemObj;
                            throw ("GOT IT!"); // 找到符合条件的节点，通过throw终止掉递归
                        }
                    } else {
                        let childList = itemObj.childList || [];
                        for(let i = 0; i < childList.length; i++) {
                            let child = childList[i];
                            loopFn(child);
                        }
                    }
                }
                loopFn(treeData);
            } catch (err) {
                return findedProject;
            }
        }

        let project = findProjectById(res.data.treeData, '316946756426268672');
        console.log(project);
    </script>
</body>
</html>